package com.android.yummycookies.model.cookie;

import android.graphics.Canvas;
import android.graphics.Rect;

import com.android.yummycookies.commonInterface.IDrawable;
import com.android.yummycookies.commonInterface.IUpdatable;
import com.android.yummycookies.types.CookieType;
import com.android.yummycookies.types.Direction;

public class Cookie {

	private CookieType type;
	private Direction direction;
	private int x;
	private int y;

	private boolean destroying;
	private int speed;

	public Cookie(CookieType type, int x, int y, Direction direction) {
		this.type = type;
		this.direction = direction;
		this.x = x;
		this.y = y;
	}

	public void draw(Canvas canvas, Rect drawingArea){
		if(!destroying){
			type.getSprite().draw(canvas, x, y, drawingArea, direction);
		}else{
			type.getDestructionSprite().draw(canvas, x, y, drawingArea, direction);
		}
	}
	
	public void update() {
		//type.gets
	}

	public void setCoordinate(int x, int y){
		setX(x);
		setY(y);
	}

	public CookieType getType() {
		return type;
	}

	public void setType(CookieType type) {
		this.type = type;
	}

	public Direction getDirection() {
		return direction;
	}

	public void setDirection(Direction direction) {
		this.direction = direction;
	}

	public int getX() {
		return x;
	}

	public void setX(int x) {
		this.x = x;
	}

	public int getY() {
		return y;
	}

	public void setY(int y) {
		this.y = y;
	}

	public boolean isDestroying() {
		return destroying;
	}

	public void setDestroying(boolean destroying) {
		this.destroying = destroying;
	}

	public int getSpeed() {
		return speed;
	}

	public void setSpeed(int speed) {
		this.speed = speed;
	}
	
	
	
	
	
}
